<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
    <title>LISPBUILDER-SDL-TTF - </title>
    <style type="text/css">

      body {
      margin: 10px 20px 20px 220px;
      padding: 0px;
      font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
      font-size: small;
      text-align: justify;
      max-width: 50em;
      background-color: white;
      }

      a, a:visited {
      text-decoration: none;
      color: maroon;
      }

      /* index */

      div.index {
      position: fixed;
      top: 0px;
      left: 0px;
      width: 180px;
      height: 100%;
      margin: 0px;
      padding: 5px;
      font-size: 12px;
      background-color: #DCDCDC;
      border-right: thin black solid;
      }

      div.index ol {
      color: navy;
      margin: 0px;
      padding-left: 0px;
      }

      div.index ol li {
      list-style: none;
      }

      div.index ol li:before {
      display: marker;
      content: counter(heading1) ". ";
      counter-increment: heading1;
      }

      div.index ol ol {
      padding-left: 10px;
      font-size: 10px;
      list-style: none;
      counter-reset: heading2;
      }

      div.index ol ol li:before {
      display: marker;
      content: counter(heading1)"." counter(heading2)" ";
      counter-increment: heading2;
      }

      /* heading styles */

      body > h1 {
      margin-top: 0px;
      }

      h1 {
      margin-top: 40px;
      margin-bottom: 0px;
      color: #4682B4;
      }

      h1:before {
      display: marker;
      content: counter(chapter) ". ";
      counter-increment: chapter;
      counter-reset: section1;
      }

      h1 + p {
      margin-top: 5px;
      }

      h2 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h2:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "  ";
      counter-increment: section1;
      }

      h2 + p {
      margin-top: 0px;
      }

      h3 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h3:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "." counter(section2) "  ";
      counter-increment: section2;
      }

      h3 + p {
      margin-top: 0px;
      }

      h4 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h4:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "." counter(section2) "." counter(section3) "  ";
      counter-increment: section3;
      }

      h4 + p {
      margin-top: 0px;
      }

      /* generated content for images and tables */

      img:after {
      content: "[" counter(image) "] " attr(title);
      counter-increment: image;
      display: block;
      font-size: 10px;
      font-weight: bold;
      margin-top: 5px;
      margin-bottom: 20px;
      color: black;
      }

      table:after {
      content: "Table " counter(table) ": " attr(summary);
      counter-increment: table;
      display: table-caption;
      caption-side: bottom;
      font-size: 10px;
      font-weight: bold;
      margin-top: 5px;
      margin-bottom: 20px;
      white-space: nowrap;
      color: black;
      }

      /* code for examples, code and pathnames*/

      div.example table {
      color: black;
      }

      div.example, div.code, div.path, div.sequence {
      margin: 10px 0px;
      border: 1px black solid;
      padding: 10px;
      background-color: #F4F4F4;
      counter-reset: image;
      color: maroon;
      }

      div.example:before {
      content: "Example " counter(example);
      counter-increment: example;
      display: block;
      }

      div.example + p {
      margin-bottom: 0px;
      }

      div.code:before {
      content: "Code";
      }

      div.path:before {
      content: "Path";
      }

      div.sequence:before {
      content: "Sequence";
      }

      p.reference:before {
      display: marker;
      content: "[" counter(reference) "]";
      counter-increment: reference;
      font-weight: bold;
      margin-right: 5px;
      }

      div.code:before, div.example:before, div.path:before, div.sequence:before {
      font-weight: bold;
      font-size: 15px;
      margin-bottom: 20px;
      color: black;
      }

      pre {
      color: Green;
      margin: 0px;
      padding: 0px;
      }


      /* equation counter */

      e:after {
      content: "[" counter(equation) "]";
      counter-increment: equation;
      display: block;
      float: right;
      margin-right: 10px;
      }

      /* to prevent the CC image from being numbered */

      img[alt="Creative Commons License"] {
      display: inline;
      }

      img[alt="Creative Commons License"]:after {
      display: none;
      }

      div#cc {
      background-color: #DCDCDC;
      border: thin black solid;
      padding: 10px;
      font-size: 10px;
      }

      /* Table Design */
      /* http://www.duoh.com/csstutorials/csstables/ */
      #mytable {
      width: 700px;
      padding: 0;
      margin: 0;
      }

      caption {
      padding: 0 0 5px 0;
      width: 700px;
      font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      text-align: right;
      }

      th {
      font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      color: #4f6b72;
      border-right: 1px solid #C1DAD7;
      border-bottom: 1px solid #C1DAD7;
      border-top: 1px solid #C1DAD7;
      letter-spacing: 2px;
      text-transform: uppercase;
      text-align: left;
      padding: 6px 6px 6px 12px;
      background: #CAE8EA url(images/bg_header.jpg) no-repeat;
      }

      th.nobg {
      border-top: 0;
      border-left: 0;
      border-right: 1px solid #C1DAD7;
      background: none;
      }

      td {
      border-right: 1px solid #C1DAD7;
      border-bottom: 1px solid #C1DAD7;
      background: #fff;
      padding: 6px 6px 6px 12px;
      color: #4f6b72;
      }


      td.alt {
      background: #F5FAFA;
      color: #797268;
      }

      th.spec {
      border-left: 1px solid #C1DAD7;
      border-top: 0;
      background: #fff url(images/bullet1.gif) no-repeat;
      font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      }

      th.specalt {
      border-left: 1px solid #C1DAD7;
      border-top: 0;
      background: #f5fafa url(images/bullet2.gif) no-repeat;
      font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      color: #797268;
      }

    </style>
  </head>

  <!--
      (CC) 2003 Luke Crook. Some Rights Reserved.
      http://creativecommons.org/licenses/by/1.0
      This page is licensed under a Creative Commons License.

      Maintained by the Common Lisp Application Builder project at www.lispbuilder.org

      The entire styleguide was copied wholesale from http://www.markschenk.com/cssexp/publication/article.xml

      (CC) 2003 Mark Schenk. Some Rights Reserved.
      http://creativecommons.org/licenses/by/1.0
      This page is licensed under a Creative Commons License.
    -->

  <BODY BGCOLOR=#FFFFFF >

    <h1><a name="top" class=none> LISPBUILDER-SDL-TTF - </a></h1>

    <blockquote>
      <br>&nbsp;</br><h2><a name=abstract class=abstract>Abstract</a></h2>

      <p>
	LISPBUILDER-SDL-TTF provides a Lisp wrapper for the
	<a href="http://www.libsdl.org/projects/SDL_ttf/">SDL_TTF</a> library,
	and provides support for loading and rendering True-Type fonts in an
	SDL application. The SDL_TTF wrapper is in itself a wrapper around the
	FreeType 1.2 library, available at: <a href="http://www.freetype.org/">Freetype Homepage</a>.
	LISPBUILDER-SDL-TTF has a dependency on the LISPBUILDER-SDL package.
	LISPBUILDER-SDL-TTF is distributed under the
	<a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
      </p>
      <p>
	<font color=red>Current Version:</font> The current version of LISPBUILDER-SDL-TTF is version <a href="#download">0.2</a>.
      </p>
<!--       <p> -->
<!-- 	<font color=red>Download shortcut:</font> <a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip</a>. -->
<!--       </p> -->
    </blockquote>

    <br>&nbsp;</br><h2><a class=none name="packageover">Package Overview</a></h2>
    <p>The TrueType library is automatically initialized and uninitialized by the LISPBUILDER-SDL package.
      The functions INIT-TTF and QUIT-TTF are added to the lists SDL:*EXTERNAL-INIT-ON-STARTUP* and
      SDL:*EXTERNAL-QUIT-ON-EXIT*. LISPBUILDER-SDL iterates over these lists in calls to SDL:INIT-SDL, SDL:QUIT-SDL
      and SDL:WITH-INIT in order to initialize or uninitialize any external libraries such as LISPBUILDER-SDL-TTF.</p>
    <p>To open a TrueType font use INITIALISE-FONT or the macro WITH-OPEN-FONT. LISPBUILDER-SDL-TTF allows more than
      one FONT to be used simultaneously within a single SDL application.
    </p>
    <p>
      LISPBUILDER-SDL-TTF has the concept of a *DEFAULT-FONT*. A FONT may be bound to *DEFAULT-FONT* by using
      INITIALISE-DEFAULT-FONT,  WITH-OPEN-FONT, or WITH-DEFAULT-FONT.
      All functions that take a &KEYword or &OPTIONAL FONT argument accept *DEFAULT-FONT* unless a FONT is specified.
      This makes calling functions a bit easier as the :FONT parameter need not be explicitely passed. For example:

      (GET-FONT-SIZE "TEXT" :SIZE :W), compared to
      (GET-FONT-SIZE "TEXT" :SIZE :W :FONT ANY-FONT)
    </p>
    <p>
      Functions and symbols exported from the LISPBUILDER-SDL-TTF package are
      accessible from the <code>LISPBUILDER-SDL-TTF:</code> prefix or the
      shorter form <code>SDL-TTF:</code> nickname.
    </p>

    <br>&nbsp;</br><h2><a class=none name="examplesimple">Simple Example</a></h2>
    <div class="example">
      <p>
	This example was created with the following code:
      </p>
      <p>
	<img src="ttf-hello-world.png" width="200" height="167" title="TTF Hello World!" alt="TTF Hello World!"/>
      </p>

      <pre>
  (sdl:with-init ()
    (sdl:window 320 240)
    (sdl-ttf:initialise-default-font)
    (sdl-ttf:draw-string-solid-* "Hello TTF World!" 25 50
			   :color (sdl:color :r 255 :g 0 :b 255))
    (sdl:with-events ()
      (:quit-event () t)
      (:video-expose-event () (sdl:update-display))))
      </pre>
    </div>

    <div class="index">
      <ol>
	<li><a href="#top">LISPBUILDER-SDL-TTF</a></li>
	<ol>
	  <li><a href="#abstract">Abstract</a></li>
	  <li><a href="#packageover">Package Overview</a></li>
	  <li><a href="#examplesimple">Simple Example</a></li>
	  <li><a href="#compatibility">Compatibility</a></li>
	  <li><a href="#download">Download</a></li>
	  <li><a href="#installation">Installation</a></li>
	  <li><a href="#build">Build Instructions</a></li>
	  <ol>
	    <li><a href="#buildwindows">Windows Instructions</a></li>
	    <li><a href="#buildlinux">Linux Instructions</a></li>
	  </ol>
	  <li><a href="#usage">Usage</a></li>
	  <li><a href="#examples">Examples</a></li>
	  <li><a href="#dependency">Dependencies</a></li>
	  <li><a href="#license">License</a></li>
	  <li><a href="#dictionar">LISPBUILDER-SDL-TTF dictionary</a></li>
	  <ol>
	    <li><a href="#dictionary">INDEX</a></li>
	  </ol>
	  <li><a href="#ack">Acknowledgements</a></li>
	</ol>
      </div>

      <br>&nbsp;</br><h2><a class=none name="dictionary">The LISPBUILDER-SDL-TTF dictionary Index</h2>
	<ol>
	        <li><a href="#*default-font*"><code>*default-font*</code></a>
	          <li><a href="#*default-font-path*"><code>*default-font-path*</code></a>
	          <li><a href="#close-font"><code>close-font</code></a>
	          <li><a href="#draw-font"><code>draw-font</code></a>
	          <li><a href="#draw-font"><code>draw-font</code></a>
	          <li><a href="#draw-font-at"><code>draw-font-at</code></a>
	          <li><a href="#draw-font-at-*"><code>draw-font-at-*</code></a>
	          <li><a href="#draw-string-blended"><code>draw-string-blended</code></a>
	          <li><a href="#draw-string-blended-*"><code>draw-string-blended-*</code></a>
	          <li><a href="#draw-string-shaded"><code>draw-string-shaded</code></a>
	          <li><a href="#draw-string-shaded-*"><code>draw-string-shaded-*</code></a>
	          <li><a href="#draw-string-solid"><code>draw-string-solid</code></a>
	          <li><a href="#draw-string-solid-*"><code>draw-string-solid-*</code></a>
	          <li><a href="#font"><code>font</code></a>
	          <li><a href="#free-font"><code>free-font</code></a>
	          <li><a href="#get-font-ascent"><code>get-font-ascent</code></a>
	          <li><a href="#get-font-descent"><code>get-font-descent</code></a>
	          <li><a href="#get-font-face-family-name"><code>get-font-face-family-name</code></a>
	          <li><a href="#get-font-face-style-name"><code>get-font-face-style-name</code></a>
	          <li><a href="#get-font-faces"><code>get-font-faces</code></a>
	          <li><a href="#get-font-height"><code>get-font-height</code></a>
	          <li><a href="#get-font-line-skip"><code>get-font-line-skip</code></a>
	          <li><a href="#get-font-size"><code>get-font-size</code></a>
	          <li><a href="#get-font-style"><code>get-font-style</code></a>
	          <li><a href="#get-glyph-metric"><code>get-glyph-metric</code></a>
	          <li><a href="#init-ttf"><code>init-ttf</code></a>
	          <li><a href="#initialise-default-font"><code>initialise-default-font</code></a>
	          <li><a href="#initialise-font"><code>initialise-font</code></a>
	          <li><a href="#is-font-face-fixed-width"><code>is-font-face-fixed-width</code></a>
	          <li><a href="#is-init"><code>is-init</code></a>
	          <li><a href="#new-font"><code>new-font</code></a>
	          <li><a href="#open-font"><code>open-font</code></a>
	          <li><a href="#quit-ttf"><code>quit-ttf</code></a>
	          <li><a href="#render-string-blended"><code>render-string-blended</code></a>
	          <li><a href="#render-string-shaded"><code>render-string-shaded</code></a>
	          <li><a href="#render-string-solid"><code>render-string-solid</code></a>
	          <li><a href="#set-font-style"><code>set-font-style</code></a>
	          <li><a href="#with-default-font"><code>with-default-font</code></a>
	          <li><a href="#with-open-font"><code>with-open-font</code></a>

	  </li>
	</ol>


      <br>&nbsp;</br><h2><a class=none name="compatibility">Compatibility</h2>
	<p>
	  The following table describes the status of the Lisp implementations that have been tested with
	  LISPBUILDER-SDL-TTF:
	</p>

	<table id="mytable" cellspacing="0" summary="Compatibility">
	  <tr>
	    <th><b>Lisp Implementation</b></th>
	    <th colspan="3"><b>LISPBUILDER-SDL-TTF Status</b></th>
	    <th><b>Comments</b></th>
	  </tr>
	  <tr>
	    <th colspan="1"></th>
	    <th><b>Win32</b></th>
	    <th><b>Linux</b></th>
	    <th><b>MacOS</b></th>
	    <th></th>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://clisp.cons.org/">CLISP v2.38</a>
	    </th>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="specalt" scope="row">
	      <a href="http://www.lispworks.com/">Lispworks v4.4.6 Personal</a>
	    </th>
	    <td class="alt" bgcolor="#60c060">Working</td>
	    <td class="alt" bgcolor="#60c060">Working</td>
	    <td class="alt" bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://www.franz.com/">Allegro Express 8.0</a>
	    </th>
	    <td bgcolor="#ff6060">Unknown</td>
	    <td bgcolor="#ff6060">Unknown</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="specalt" scope="row">
	      <a href="http://openmcl.clozure.com/">OpenMCL</a>
	    </th>
	    <td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
	    <td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
	    <td class="alt" bgcolor="#ff6060">Unknown</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://www.sbcl.org/">SBCL</a>
	    </th>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	</table>


	<br>&nbsp;</br><h2><a class=none name="download">Download</a></h2>
	<ul>
	  <li><font color=red>Development:</font> Available via anonymous SVN at:
	    <pre>
	      svn co https://lispbuilder.svn.sourceforge.net/svnroot/lispbuilder lispbuilder
	    </pre>
	  </li>
	  <li>
	    <font color=red>Stable:</font> The latest stable versions are available from the
	    <a href="http://sourceforge.net/project/showfiles.php?group_id=159740">LISPBUILDER-SDL repository on SourceForge.</a>
	  </li>
	  <li>
	    <font color=red>The Edi Weitz 'Starter Pack' Version:</font> The stable version of Lispbuilder,
	    suitable for the installation of installation LISPBUILDER-SDL-TTF using the Lisp Starter Pack from Edi Weitz is can be downloaded from
	    <a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-ttf.zip</a>.
	  </li>
	</ul>

	<br>&nbsp;</br><h2><a class=none name="installation">Installation</a></h2>
	<p>See <a href="http://lispbuilder.sourceforge.net/index.html#installation">the LISPBUILDER documentation</a>
	  for installation instructions.
	</p>
	<br>&nbsp;</br><h2><a class=none name="build">Build Instructions</a></h2>
	<p>LISPBUILDER-SDL-TTF requires that a glue library <code>lispbuilder-sdl-ttf-glue</code> is also installed
	  in the library search path. <code>lispbuilder-sdl-ttf-glue</code> wraps the native font rendering functions
	  provided by <code>SDL_TTF</code> as these functions require that a <code>SDL_Color</code> struct is passed
	  by value. However CFFI only supports passing structs by reference.
	</p>
	<br>&nbsp;</br><h3><a class=none name="buildwindows">Windows Build Instructions</a></h2>
	<p><code>lispbuilder-sdl-ttf-glue</code> is installed as part of the <code>LISPBUILDER-SDL-TTF-BINARIES</code>
	  package into the directory <code>LISPBUILDER-SDL-TTF/BIN</code>.
	</p>
	<p>To rebuild the glue library:
	  <ol>
	    <li>A working installation of <a href="http://www.mingw.org/">MingW</a> is required.</i>
	    <li>Make sure that the path to the include files for SDL and SDL_TTF are specified
	      correctly in <code>LISPBUILDER-SDL-TTF/Makefile.mingw</code>. Modify the existing line
	      <code>SDL_TTF_CFLAGS=$(CFLAGS) -ISDL-1.2.11/include -ISDL_ttf-2.0.8</code>.</li>
	    <li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make</code>
	      to create the glue library.</li>
	    <li>If the build is successful, the <code>lispbuilder-sdl-ttf-glue</code> library will be found in the
	      <code>LISPBUILDER-SDL-TTF/BUILD/</code> directory.</li>
	    <li>Copy or move this file <code>LISPBUILDER-SDL-TTF/BUILD/lispbuilder-sdl-ttf-glue.dll</code> to the
	      <code>BIN</code> directory <code>LISPBUILDER-SDL-TTF/BIN/lispbuilder-sdl-ttf-glue.dll</code></li>
	  </ol>
	</p>

	<br>&nbsp;</br><h3><a class=none name="buildlinux">Linux Build Instructions</a></h2>
	<p>To rebuild the glue library:
	  <ol>
	    <li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make</code>
	      to create the glue library.</li>
	    <li>If the build is successful, the <code>lispbuilder-sdl-ttf-glue</code> library will be found in the
	      <code>LISPBUILDER-SDL-TTF/BUILD/</code> directory.</li>
	    <li>In the <code>LISPBUILDER-SDL-TTF/</code> directory, execute <code>make install_ttf</code>
	      to install the <code>lispbuilder-sdl-ttf-glue</code> library.</li>
	  </ol>
	</p>


	<br>&nbsp;</br><h2><a class=none name="usage">Using LISPBUILDER-SDL-TTF</a></h2>
	<p>See <a href="http://lispbuilder.sourceforge.net/index.html#usage">the LISPBUILDER documentation</a>
	  for Usage instructions.
	</p>

	<br>&nbsp;</br><h2><a class=none name="examples">Running Examples in LISPBUILDER-SDL-TTF-EXAMPLES</a></h2>
	<p>The following examples are contained in the package LISPBUILDER-SDL-TTF-EXAMPLES:
	</p>
	<ul>
	  <li>(SDL-TTF-EXAMPLES:FONT-EXAMPLE)</li>
	</ul>
	<p>Enter the following at the REPL to load the examples in the
	  LISPBUILDER-SDL-TTF-EXAMPLES package:</p>
	<pre>
	  (asdf:operate 'asdf:load-op :lispbuilder-sdl-TTF-examples)
	</pre>


	<br>&nbsp;</br><h2><a class=none name="dependency">Dependencies</a></h2>
	<p>LISPBUILDER-SDL-TTF has a dependency on LISPBUILDER-SDL.</p>


	<br>&nbsp;</br><h2><a class=none name="license">License</a></h2>
	<p>
	  LISPBUILDER-SDL-TTF is distributed under the
	  <a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
	</p>



	<br>&nbsp;</br><h2><a class=none name="dictionar">The LISPBUILDER-SDL-TTF dictionary</a></h2>





<!-- Entry for *DEFAULT-FONT* -->

<p><br>[Special variable]<br><a class=none name='*default-font*'><b>*default-font*</b></a>
<blockquote><br>

<p>When a <code>LISPBUILDER-SDL-TTF</code> function or macro has an <code>OPTIONAL</code> or <code>KEY</code>word argument  <code>FONT</code>, the default action is to bind to <code>*DEFAULT-FONT*</code>. <code>*DEFAULT-FONT*</code> is set to <code>NIL</code> initially. A font must be initialized by calling <a href="#with-open-font">WITH-OPEN-FONT</a>,  <a href="#initialise-font">INITIALISE-FONT</a>, or <a href="#initialise-default-font">INITIALISE-DEFAULT-FONT</a>.  These will bind <code>*DEFAULT-FONT*</code> to a Truetype font <code>FONT</code>. </p>

</blockquote>

<!-- End of entry for *DEFAULT-FONT* -->


<!-- Entry for *DEFAULT-FONT-PATH* -->

<p><br>[Special variable]<br><a class=none name='*default-font-path*'><b>*default-font-path*</b></a>
<blockquote><br>

<p>The path to the default Truetype font, <code>&amp;quot;Bitstream Vera&amp;quot;</code></p>

</blockquote>

<!-- End of entry for *DEFAULT-FONT-PATH* -->


<!-- Entry for CLOSE-FONT -->

<p><br>[Function]<br><a class=none name='close-font'><b>close-font</b> <i><tt>&amp;key</tt> font *default-font*</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Closes the font <code>FONT</code> when the <code>SDL_TTF</code> font library is intitialized.  NOTE: <code>CLOSE-FONT</code> does not uninitialise the font library, and does not bind <code>*DEFAULT-FONT*</code> to <code>NIL</code>. Returns <code>T</code>  if successful, or <code>NIL</code> if the font cannot be closed or the <code>SDL_TTF</code> font library is not initialized. </p>

</blockquote>

<!-- End of entry for CLOSE-FONT -->


<!-- Entry for DRAW-FONT -->

<p><br>[Generic function]<br><a class=none name='draw-font'><b>draw-font</b> <i><tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Blit the cached SURFACE in FONT to the destination surface SURFACE.  The cached surface is created during a previous call to any of the DRAW-STRING* functions.  Uses POSITION in the cached SURFACE to render to the X/Y coordinates on the destination SURFACE.  </p><p>This function can speed up blitting when the text remains unchanged between screen updates. </p>

</blockquote>

<!-- End of entry for DRAW-FONT -->


<!-- Entry for DRAW-FONT -->

<p><br>[Function]<br><a class=none name='draw-font'><b>draw-font</b> <i><tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>



</blockquote>

<!-- End of entry for DRAW-FONT -->


<!-- Entry for DRAW-FONT-AT -->

<p><br>[Generic function]<br><a class=none name='draw-font-at'><b>draw-font-at</b> <i>position <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>See DRAW-FONT.  POINT is used to position the cached SURFACE, where POINT is of type SDL:POINT. </p>

</blockquote>

<!-- End of entry for DRAW-FONT-AT -->


<!-- Entry for DRAW-FONT-AT -->

<p><br>[Method]<br><a class=none><b>draw-font-at</b> <i>position <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>



</blockquote>

<!-- End of entry for DRAW-FONT-AT -->


<!-- Entry for DRAW-FONT-AT-* -->

<p><br>[Generic function]<br><a class=none name='draw-font-at-*'><b>draw-font-at-*</b> <i>x y <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>See DRAW-FONT.  X and Y are used to position the cached SURFACE, where X and Y are INTEGERS. </p>

</blockquote>

<!-- End of entry for DRAW-FONT-AT-* -->


<!-- Entry for DRAW-FONT-AT-* -->

<p><br>[Method]<br><a class=none><b>draw-font-at-*</b> <i>x y <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>



</blockquote>

<!-- End of entry for DRAW-FONT-AT-* -->


<!-- Entry for DRAW-STRING-BLENDED -->

<p><br>[Function]<br><a class=none name='draw-string-blended'><b>draw-string-blended</b> <i>text position <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>See <a href="#draw-string-blended-*">DRAW-STRING-BLENDED-*</a>. </p><ul><li><code>POSITION</code> is the <code>X</code> and <code>Y</code> coordinates to render <code>TEXT</code>, of type <code>SDL:POINT</code>. </li>
</ul>

</blockquote>

<!-- End of entry for DRAW-STRING-BLENDED -->


<!-- Entry for DRAW-STRING-BLENDED-* -->

<p><br>[Function]<br><a class=none name='draw-string-blended-*'><b>draw-string-blended-*</b> <i>text x y <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Draw text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> onto surface <code>SURFACE</code>, using the Blended mode.  </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>X</code> and <code>Y</code> are the x and y coordinates of the <code>TEXT</code>, as <code>INTEGER</code>s. </li>
<li><code>FONT</code> is a <code>FONT</code> object.  Binds to <code>*DEFAULT-FONT*</code> by default.  </li>
<li><code>SURFACE</code> is the target surface, of type <code>SDL:SDL-SURFACE</code>.  </li>
<li><code>COLOR</code> is the color used to render <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
</ul><h5>Return </h5>
<ul><li>Returns the font <code>FONT</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-SOLID-* &amp;quot;Hello World!&amp;quot; 0 0 :FONT *DEFAULT-FONT* :SURFACE A-SURFACE :COLOR A-COLOR)
</code></pre>

</blockquote>

<!-- End of entry for DRAW-STRING-BLENDED-* -->


<!-- Entry for DRAW-STRING-SHADED -->

<p><br>[Function]<br><a class=none name='draw-string-shaded'><b>draw-string-shaded</b> <i>text position fg-color bg-color <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>See <a href="#draw-string-shaded-*">DRAW-STRING-SHADED-*</a></p><h5>Parmeters </h5>
<ul><li><code>POSITION</code> is the <code>X</code> and <code>Y</code> coordinates to render <code>TEXT</code>, of type <code>SDL:POINT</code>. </li>
</ul>

</blockquote>

<!-- End of entry for DRAW-STRING-SHADED -->


<!-- Entry for DRAW-STRING-SHADED-* -->

<p><br>[Function]<br><a class=none name='draw-string-shaded-*'><b>draw-string-shaded-*</b> <i>text x y fg-color bg-color <tt>&amp;key</tt> font surface</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Draw text <code>TEXT</code> using font <code>FONT</code> with foreground color <code>FG-COLOR</code> and background color <code>BG-COLOR</code>  onto surface <code>SURFACE</code>, using the Shaded mode.  </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>X</code> and <code>Y</code> are the x and y coordinates of the <code>TEXT</code>, as <code>INTEGER</code>s. </li>
<li><code>FG-COLOR</code> is the foreground color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>BG-COLOR</code> is the background color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FONT</code> is a <code>FONT</code> object.  Binds to <code>*DEFAULT-FONT*</code> by default.  </li>
<li><code>SURFACE</code> is the target surface, of type <code>SDL:SDL-SURFACE</code>.  </li>
</ul><h5>Return </h5>
<ul><li>Returns the font <code>FONT</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-SHADED-* &amp;quot;Hello World!&amp;quot; 0 0 fg-col bg-col :FONT *DEFAULT-FONT* :SURFACE A-SURFACE)
</code></pre>

</blockquote>

<!-- End of entry for DRAW-STRING-SHADED-* -->


<!-- Entry for DRAW-STRING-SOLID -->

<p><br>[Function]<br><a class=none name='draw-string-solid'><b>draw-string-solid</b> <i>text position <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>See <a href="#draw-string-solid-*">DRAW-STRING-SOLID-*</a>. </p><h5>Parmeters </h5>
<ul><li><code>POSITION</code> is the <code>X</code> and <code>Y</code> coordinates to render <code>TEXT</code>, of type <code>SDL:POINT</code>. </li>
</ul>

</blockquote>

<!-- End of entry for DRAW-STRING-SOLID -->


<!-- Entry for DRAW-STRING-SOLID-* -->

<p><br>[Function]<br><a class=none name='draw-string-solid-*'><b>draw-string-solid-*</b> <i>text x y <tt>&amp;key</tt> font surface color</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Draw text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> onto surface <code>SURFACE</code>, using the Solid mode.  </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>X</code> and <code>Y</code> are the x and y coordinates of the <code>TEXT</code>, as <code>INTEGER</code>s. </li>
<li><code>FONT</code> is a <code>FONT</code> object.  Binds to <code>*DEFAULT-FONT*</code> by default.  </li>
<li><code>SURFACE</code> is the target surface, of type <code>SDL:SDL-SURFACE</code>.  </li>
<li><code>COLOR</code> is the color used to render <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
</ul><h5>Return </h5>
<ul><li>Returns the font <code>FONT</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-SOLID-* &amp;quot;Hello World!&amp;quot; 0 0 :FONT *DEFAULT-FONT* :SURFACE A-SURFACE :COLOR A-COLOR)
</code></pre>

</blockquote>

<!-- End of entry for DRAW-STRING-SOLID-* -->


<!-- Entry for FONT -->

<p><br>[Standard class]<br><a class=none name='font'><b>font</b></a>
<blockquote><br>

<p>A <code>FONT</code> object is wrapper around a foreign <code>TTF_Font</code> object.  </p><p>The <code>FONT</code> object maintains the most recent surface <code>SDL:SURFACE</code> created by a call to any of the  <code>RENDER-STRING*</code> functions. Use <a href="#draw-font">DRAW-FONT</a>, <a href="#draw-font-at">DRAW-FONT-AT</a>  or <a href="#draw-font-at-*">DRAW-FONT-AT-*</a> to draw the cached surface. </p><p>Prior to the first call to a <code>RENDER-STRING*</code> function, the cached surface is <code>NIL</code>. </p>

</blockquote>

<!-- End of entry for FONT -->


<!-- Entry for FREE-FONT -->

<p><br>[Generic function]<br><a class=none name='free-font'><b>free-font</b> <i>font</i> =&gt; <i>result</i></a>
<blockquote><br>



</blockquote>

<!-- End of entry for FREE-FONT -->


<!-- Entry for FREE-FONT -->

<p><br>[Method]<br><a class=none><b>free-font</b> <i>(font font)</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Free the resources used by the font <code>FONT</code>.  Free&#039;s any cached surface. Closes the <code>TTF_Font</code> object only when the <code>FONT</code> was created within the  current <a href="#init-ttf">INIT-TTF</a>/<a href="#quit-ttf">QUIT-TTF</a> sequence.  In other words, when <code>(EQ (GENERATION FONT) *GENERATION)</code>. Otherwise it is assumed that the <code>TTF_Font</code>  was closed in a previous call to <code>QUIT-TTF</code>. </p>

</blockquote>

<!-- End of entry for FREE-FONT -->


<!-- Entry for GET-FONT-ASCENT -->

<p><br>[Function]<br><a class=none name='get-font-ascent'><b>get-font-ascent</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the maximum pixel ascent of all glyphs of font <code>FONT</code>.  This can also be interpreted as the distance from the top of the font to the baseline.  It could be used when drawing an individual glyph relative to a top point,  by combining it with the glyph&#039;s maxy metric to resolve the top of the rectangle used when  blitting the glyph on the screen.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the ascent of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-ASCENT -->


<!-- Entry for GET-FONT-DESCENT -->

<p><br>[Function]<br><a class=none name='get-font-descent'><b>get-font-descent</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the maximum pixel descent of all glyphs of font <code>FONT</code>.  This can also be interpreted as the distance from the baseline to the bottom of the font.  It could be used when drawing an individual glyph relative to a bottom point,  by combining it with the glyph’s maxy metric to resolve the top of the rectangle used when  blitting the glyph on the screen.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the descent of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-DESCENT -->


<!-- Entry for GET-FONT-FACE-FAMILY-NAME -->

<p><br>[Function]<br><a class=none name='get-font-face-family-name'><b>get-font-face-family-name</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the current font face family name of font <code>FONT</code> or <code>NIL</code> if the information is unavailable.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the name of the <code>FONT</code> face family name as a <code>STRING</code>, or <code>NIL</code> if unavailable. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-FACE-FAMILY-NAME -->


<!-- Entry for GET-FONT-FACE-STYLE-NAME -->

<p><br>[Function]<br><a class=none name='get-font-face-style-name'><b>get-font-face-style-name</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the current font face style name of font <code>FONT</code>, or <code>NIL</code> if the information is unavailable.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the name of the <code>FONT</code> face style as a <code>STRING</code>, or <code>NIL</code> if unavailable. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-FACE-STYLE-NAME -->


<!-- Entry for GET-FONT-FACES -->

<p><br>[Function]<br><a class=none name='get-font-faces'><b>get-font-faces</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the number of faces &#039;sub-fonts&#039; available in the font <code>FONT</code>.  This is a count of the number of specific fonts (based on size and style and other  typographical features perhaps) contained in the font itself. It seems to be a useless  fact to know, since it can’t be applied in any other <code>SDL_TTF</code> functions. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the number of faces in the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-FACES -->


<!-- Entry for GET-FONT-HEIGHT -->

<p><br>[Function]<br><a class=none name='get-font-height'><b>get-font-height</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the maximum pixel height of all glyphs of font <code>FONT</code>.  Use this height for rendering text as close together vertically as possible,  though adding at least one pixel height to it will space it so they can&#039;t touch.  Remember that <code>SDL_TTF</code> doesn&#039;t handle multiline printing so you are responsible  for line spacing, see <a href="#get-font-line-skip">GET-FONT-LINE-SKIP</a> as well.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default.  </li>
</ul><h5>Returns </h5>
<ul><li>Retuns the height of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-HEIGHT -->


<!-- Entry for GET-FONT-LINE-SKIP -->

<p><br>[Function]<br><a class=none name='get-font-line-skip'><b>get-font-line-skip</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the recommended pixel height of a rendered line of text of the font <code>FONT</code>.  This is usually larger than the <a href="#get-font-height">GET-FONT-HEIGHT</a> of the font.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Returns the pixel height of the <code>FONT</code> as an <code>INTEGER</code>. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-LINE-SKIP -->


<!-- Entry for GET-FONT-SIZE -->

<p><br>[Function]<br><a class=none name='get-font-size'><b>get-font-size</b> <i>text <tt>&amp;key</tt> size font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Calculates and returns the resulting <code>SIZE</code> of the <code>SDL:SURFACE</code> that is required to render the  text <code>TEXT</code>, or <code>NIL</code> on error. No actual rendering is performed, however correct kerning is calculated for the  actual width. The height returned is the same as returned using <a href="#get-font-height">GET-FONT-HEIGHT</a>.  </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the string to size, of type <code>STRING</code>.  </li>
<li><code>SIZE</code> must be one of; <code>:W</code> for the text width or <code>:H</code> for the text height. </li>
<li><code>FONT</code> is the font used to calculate the size of the <code>TEXT</code>. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Return </h5>
<ul><li>Returns the width or height of the specified <code>SDL:SURFACE</code>, or <code>NIL</code> upon error. </li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-SIZE -->


<!-- Entry for GET-FONT-STYLE -->

<p><br>[Function]<br><a class=none name='get-font-style'><b>get-font-style</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the rendering style of the font <code>FONT</code>. If no style is set then <code>:STYLE-NORMAL</code> is returned,  or <code>NIL</code> upon error. </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binfs to <code>*DEFAULT-FONT*</code> by default.  </li>
</ul><h5>Return </h5>
<ul><li>Retuns the font style as one or more of: <code>:STYLE-NORMAL</code>, <code>:STYLE-BOLD</code>, <code>:STYLE-ITALIC</code>, <code>:STYLE-UNDERLINE</code></li>
</ul>

</blockquote>

<!-- End of entry for GET-FONT-STYLE -->


<!-- Entry for GET-GLYPH-METRIC -->

<p><br>[Function]<br><a class=none name='get-glyph-metric'><b>get-glyph-metric</b> <i>ch <tt>&amp;key</tt> metric font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the glyph metrics <code>METRIC</code> for the character <code>CH</code>, or <code>NIL</code> upon error.  </p><h5>Parameters </h5>
<ul><li><code>CH</code> is a UNICODE chararacter specified as an <code>INTEGER</code>. </li>
<li><code>FONT</code> is a <code>FONT</code> object from which to retrieve the glyph metrics of the character <code>CH</code>. Binds to <code>*DEFAULT-FONT*</code>  by default. </li>
<li><code>METRIC</code> is a <code>KEY</code>word argument and may be one of;  <code>:MINX</code>, for the minimum <code>X</code> offset.   <code>:MAXX</code>, for the maximum <code>X</code> offset.  <code>:MINY</code>, for the minimum <code>Y</code> offset.  <code>:MAXY</code>, for the maximum <code>Y</code> offset.  <code>:ADVANCE</code>, for the advance offset.  </li>
</ul><h5>Return </h5>
<ul><li>Returns the glyph metric as an <code>INTEGER</code>. </li>
</ul><h5>Example </h5>
<pre><code>(GET-GLYPH-METRIC UNICODE-CHAR :METRIC :MINX :FONT *DEFAULT-FONT*)
</code></pre>

</blockquote>

<!-- End of entry for GET-GLYPH-METRIC -->


<!-- Entry for INIT-TTF -->

<p><br>[Function]<br><a class=none name='init-ttf'><b>init-ttf</b> <i></i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Initializes the <code>SDL_TTF</code> font library if uninitialized. Returns <code>T</code> if the library was uninitialized and  is successfully initialized, or else returns <code>NIL</code> if uninitialized. </p>

</blockquote>

<!-- End of entry for INIT-TTF -->


<!-- Entry for INITIALISE-DEFAULT-FONT -->

<p><br>[Function]<br><a class=none name='initialise-default-font'><b>initialise-default-font</b> <i><tt>&amp;optional</tt> free filename size</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Creates a new <code>FONT</code> object that is loaded from the file at location <code>FILENAME</code>, and binds this to the symbol  <code>*DEFAULT-FONT*</code>. Although several truetype fonts may used within a single SDL application, only a single  <code>FONT</code> may be bound to the symbol <code>*DEFAULT-FONT*</code> at any one time. Generates an <code>ERROR</code> if <code>FREE</code> is <code>NIL</code>  and <code>*DEFAULT-FONT*</code> is already bound to a <code>FONT</code> when <code>INITIALISE-DEFAULT-FONT</code> is called. </p><h5>Parameters </h5>
<ul><li><code>FREE</code> when set to <code>T</code> will automatically free any font that is already bound to <code>*DEFAULT-FONT*</code>. </li>
<li><code>FILENAME</code> is the optional file name of the font, as a STRING. Default value is <code>Vera.ttf</code>. </li>
<li><code>SIZE</code> is the <code>INTEGER</code> point size of the new <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns a new <code>FONT</code>, or <code>NIL</code> if unsuccessful. </li>
</ul>

</blockquote>

<!-- End of entry for INITIALISE-DEFAULT-FONT -->


<!-- Entry for INITIALISE-FONT -->

<p><br>[Function]<br><a class=none name='initialise-font'><b>initialise-font</b> <i>filename size</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Creates a new <code>FONT</code> object of size <code>SIZE</code> loaded from the file at location <code>FILENAME</code>. Automatically initialises the <code>SDL_TTF</code> truetype font library if the library is uninitialised when <code>FONT</code> is loaded.  </p><h5>Parameters </h5>
<ul><li><code>FILENAME</code> is the file name of the <code>FONT</code>, of type <code>STRING</code>. </li>
<li><code>SIZE</code> is the <code>INTEGER</code> point size of the new <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns a new <code>FONT</code>, or <code>NIL</code> if unsuccessful. </li>
</ul>

</blockquote>

<!-- End of entry for INITIALISE-FONT -->


<!-- Entry for IS-FONT-FACE-FIXED-WIDTH -->

<p><br>[Function]<br><a class=none name='is-font-face-fixed-width'><b>is-font-face-fixed-width</b> <i><tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns <code>T</code> if the font face is of a fixed width, or <code>NIL</code> otherwise.  Fixed width fonts are monospace, meaning every character that exists in the font is the same width.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default. </li>
</ul><h5>Returns </h5>
<ul><li>Retuns <code>T</code> if <code>FONT</code> is of fixed width, and <code>NIL</code> otherwise. </li>
</ul>

</blockquote>

<!-- End of entry for IS-FONT-FACE-FIXED-WIDTH -->


<!-- Entry for IS-INIT -->

<p><br>[Function]<br><a class=none name='is-init'><b>is-init</b> <i></i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Queries the initialization status of the <code>SDL_TTF</code> truetype library.  Returns <code>T</code> if this library is already initialized and <code>NIL</code> if uninitialized. </p>

</blockquote>

<!-- End of entry for IS-INIT -->


<!-- Entry for NEW-FONT -->

<p><br>[Function]<br><a class=none name='new-font'><b>new-font</b> <i>fp</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Creates and returns a new <code>FONT</code> object when <code>FP</code> is a pointer to a foreign <code>TTF_Font</code> object.  Returns <code>NIL</code> otherwise. </p>

</blockquote>

<!-- End of entry for NEW-FONT -->


<!-- Entry for OPEN-FONT -->

<p><br>[Function]<br><a class=none name='open-font'><b>open-font</b> <i>filename size</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Creates a new <code>FONT</code> from the file loaded at the location specified by <code>FILENAME</code>.  NOTE: Does not bind the new <code>FONT</code> to <code>*DEFAULT-FONT*</code>. Does not attempt to initialize the <code>SDL_TTF</code>  truetype library if the library is uninitialised.  </p><h5>Parameters </h5>
<ul><li><code>FILENAME</code> is the name of the truetype font to be loaded, of type <code>STRING</code></li>
<li><code>SIZE</code> is the size of the <code>FONT</code>, as an <code>INTEGER</code>.  </li>
</ul><h5>Returns </h5>
<ul><li>Returns new <code>FONT</code> object if successful, returns <code>NIL</code> if unsuccessful. </li>
</ul>

</blockquote>

<!-- End of entry for OPEN-FONT -->


<!-- Entry for QUIT-TTF -->

<p><br>[Function]<br><a class=none name='quit-ttf'><b>quit-ttf</b> <i></i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Uninitializes the <code>SDL_TTF</code> font library if already initialized. Increments the <code>*generation*</code> count. Returns <code>NIL</code>. </p>

</blockquote>

<!-- End of entry for QUIT-TTF -->


<!-- Entry for RENDER-STRING-BLENDED -->

<p><br>[Function]<br><a class=none name='render-string-blended'><b>render-string-blended</b> <i>text <tt>&amp;key</tt> font color free cache</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Render text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> into a new <code>SURFACE</code>, using the Blended mode.  Unless <code>:FREE T</code>, the caller is responsible for freeing the new <code>SURFACE</code>. Use <code>:CACHE T</code> to cache the newly created surface in the <code>FONT</code> object. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default.  </li>
<li><code>COLOR</code> is the color used to render the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FREE</code> when <code>T</code> will free the existing cached <code>SURFACE</code> in <code>FONT</code>. </li>
<li><code>CACHE</code> when <code>T</code> will cache the newly created <code>SURFACE</code> in <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns the new surface <code>SDL:SDL-SURFACE</code>. </li>
</ul><h5>Example </h5>
<pre><code>(DRAW-STRING-BLENDED &amp;quot;Hello World!&amp;quot; :FONT *DEFAULT-FONT* :COLOR A-COLOR)
</code></pre>

</blockquote>

<!-- End of entry for RENDER-STRING-BLENDED -->


<!-- Entry for RENDER-STRING-SHADED -->

<p><br>[Function]<br><a class=none name='render-string-shaded'><b>render-string-shaded</b> <i>text fg-color bg-color <tt>&amp;key</tt> font free cache</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Render text <code>TEXT</code> using font <code>FONT</code> with foreground and background colors <code>FG-COLOR</code> and <code>BG-COLOR</code>  into a new <code>SURFACE</code>, using the Solid mode.  Unless <code>:FREE T</code>, the caller is responsible for freeing the new <code>SURFACE</code>. Use <code>:CACHE T</code> to cache the newly created surface in the <code>FONT</code> object. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>FG-COLOR</code> is the foreground color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>BG-COLOR</code> is the background color of the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FONT</code> is a <code>FONT</code> object.  Binds to *<code>DEFAULT-FONT*</code> by default.  </li>
<li><code>FREE</code> when <code>T</code> will free the existing cached <code>SURFACE</code> in <code>FONT</code>. </li>
<li><code>CACHE</code> when <code>T</code> will cache the newly created <code>SURFACE</code> in <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns the new surface <code>SDL:SDL-SURFACE</code>. </li>
</ul><h5>Example </h5>
<p>(DRAW-STRING-SHADED &quot;Hello World!&quot; fg-col bg-col  :FONT <EM>DEFAULT-FONT</EM> :COLOR A-COLOR) </p>

</blockquote>

<!-- End of entry for RENDER-STRING-SHADED -->


<!-- Entry for RENDER-STRING-SOLID -->

<p><br>[Function]<br><a class=none name='render-string-solid'><b>render-string-solid</b> <i>text <tt>&amp;key</tt> font color free cache</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Render text <code>TEXT</code> using font <code>FONT</code> with color <code>COLOR</code> into a new <code>SURFACE</code>, using the Solid mode.  Unless <code>:FREE T</code>, the caller is responsible for freeing the new <code>SURFACE</code>. Use <code>:CACHE T</code> to cache the newly created surface in the <code>FONT</code> object. </p><h5>Parameters </h5>
<ul><li><code>TEXT</code> is the text to render, of type <code>STRING</code>. </li>
<li><code>FONT</code> is a <code>FONT</code> object. Binds to <code>*DEFAULT-FONT*</code> by default.  </li>
<li><code>COLOR</code> is the color used to render the <code>TEXT</code>, of type <code>SDL:SDL-COLOR</code></li>
<li><code>FREE</code> when <code>T</code> will free the existing cached <code>SURFACE</code> in <code>FONT</code>. </li>
<li><code>CACHE</code> when <code>T</code> will cache the newly created <code>SURFACE</code> in <code>FONT</code>. </li>
</ul><h5>Return </h5>
<ul><li>Returns the new surface <code>SDL:SDL-SURFACE</code>. </li>
</ul><h5>Example </h5>
<pre><code> (DRAW-STRING-SOLID &amp;quot;Hello World!&amp;quot; :FONT *DEFAULT-FONT* :COLOR A-COLOR)
</code></pre>

</blockquote>

<!-- End of entry for RENDER-STRING-SOLID -->


<!-- Entry for SET-FONT-STYLE -->

<p><br>[Function]<br><a class=none name='set-font-style'><b>set-font-style</b> <i>style <tt>&amp;key</tt> font</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Sets the rendering style <code>STYLE</code> of font <code>FONT</code>. This will flush the internal cache of previously  rendered glyphs, even if there is no change in style, so it may be best to check the  current style using <a href="#get-font-style">GET-FONT-STYLE</a> first.  </p><h5>Parameters </h5>
<ul><li><code>FONT</code> is a <code>FONT</code> object.  </li>
<li><code>STYLE</code> is a list of one or more: <code>:STYLE-NORMAL</code>, <code>:STYLE-BOLD</code>, <code>:STYLE-ITALIC</code>, <code>:STYLE-UNDERLINE</code>.  NOTE: Combining <code>:STYLE-UNDERLINE</code> with anything  can cause a segfault, other combinations may also do this. </li>
</ul>

</blockquote>

<!-- End of entry for SET-FONT-STYLE -->


<!-- Entry for WITH-DEFAULT-FONT -->

<p><br>[Macro]<br><a class=none name='with-default-font'><b>with-default-font</b> <i>(font) declaration* statement*</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Binds <code>FONT</code> to <code>*DEFAULT-FONT*</code> within the scope of <code>WITH-DEFAULT-FONT</code>. </p>

</blockquote>

<!-- End of entry for WITH-DEFAULT-FONT -->


<!-- Entry for WITH-OPEN-FONT -->

<p><br>[Macro]<br><a class=none name='with-open-font'><b>with-open-font</b> <i>(font-name size) declaration* statement*</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>This is a convenience macro that will first attempt to initialize the truetype font library and if successful,  will then open the font in the file <code>FONT-NAME</code> prior to evaluating the forms in <code>BODY</code>.  Will exit if the library cannot be initialized or the <code>FONT</code> cannot be opened.  Closes <code>FONT</code> after the forms in  <code>BODY</code> have evaluated.  </p><p>Binds <code>FONT</code> to a shadowed instance of <code>*DEFAULT-FONT*</code> valid within the scope of <code>WITH-OPEN-FONT</code>.  <code>WITH-OPEN-FONT</code> calls may be nested. </p><h5>Parameters </h5>
<ul><li><code>FONT-NAME</code> is the file name of the truetype font to be opened, of type <code>STRING</code>. </li>
<li><code>SIZE</code> is the <code>INTEGER</code> point size of the font. </li>
</ul>

</blockquote>

<!-- End of entry for WITH-OPEN-FONT -->
<br>&nbsp;<br><h3><a class=none name="ack">Acknowledgements</a></h3>

<ul>
  <li>
    Documentation prepared using:
  </li>
  <ul>
    <li>
      Edi Weitz's
      <a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a>.
    </li>
    <li>
      Gary King's
      <a href="http://common-lisp.net/project/cl-markdown/">CL-MARKDOWN</a>.
      </li>
  </ul>
</ul>

<p>
  <a href="index.html">BACK</a>
</p>

</body>
</html>
